home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / ColorP.h.z / ColorP.h
C/C++ Source or Header  |  2002-10-15  |  3KB  |  112 lines

  1. /* $XConsortium: ColorP.h /main/4 1995/07/15 20:49:10 drk $ */
  2. /*
  3.  *  @OSF_COPYRIGHT@
  4.  *  COPYRIGHT NOTICE
  5.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  6.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  7.  *  the full copyright text.
  8.  */
  9. /*
  10.  * HISTORY
  11.  */
  12.  
  13. #ifndef _ColorP_h
  14. #define _ColorP_h
  15.  
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19.  
  20.  
  21. /* Default Color Allocation proc */
  22.  
  23. #define DEFAULT_ALLOCCOLOR_PROC       (XAllocColor)
  24.  
  25. /*  Defines and functions for processing dynamic defaults  */
  26.  
  27. #define XmMAX_SHORT     65535
  28.  
  29. #define XmCOLOR_PERCENTILE (XmMAX_SHORT / 100)
  30. #define BoundColor(value)\
  31.     ((value < 0) ? 0 : (((value > XmMAX_SHORT) ? XmMAX_SHORT : value)))
  32.  
  33. /* Contributions of each primary to overall luminosity, sum to 1.0 */
  34.  
  35. #define XmRED_LUMINOSITY     0.30
  36. #define XmGREEN_LUMINOSITY     0.59
  37. #define XmBLUE_LUMINOSITY     0.11
  38.  
  39. /* Percent effect of intensity, light, and luminosity & on brightness,
  40.    sum to 100 */
  41.  
  42. #define XmINTENSITY_FACTOR  75
  43. #define XmLIGHT_FACTOR       0
  44. #define XmLUMINOSITY_FACTOR 25
  45.  
  46. /* LITE color model
  47.    percent to interpolate RGB towards black for SEL, BS, TS */
  48.  
  49. #define XmCOLOR_LITE_SEL_FACTOR  15
  50. #define XmCOLOR_LITE_BS_FACTOR   40
  51. #define XmCOLOR_LITE_TS_FACTOR   20
  52.  
  53. /* DARK color model
  54.    percent to interpolate RGB towards white for SEL, BS, TS */
  55.  
  56. #define XmCOLOR_DARK_SEL_FACTOR  15
  57. #define XmCOLOR_DARK_BS_FACTOR   30
  58. #define XmCOLOR_DARK_TS_FACTOR   50
  59.  
  60. /* STD color model
  61.    percent to interpolate RGB towards black for SEL, BS
  62.    percent to interpolate RGB towards white for TS
  63.    HI values used for high brightness (within STD)
  64.    LO values used for low brightness (within STD)
  65.    Interpolate factors between HI & LO values based on brightness */
  66.  
  67. #define XmCOLOR_HI_SEL_FACTOR  15
  68. #define XmCOLOR_HI_BS_FACTOR   40
  69. #define XmCOLOR_HI_TS_FACTOR   60
  70.  
  71. #define XmCOLOR_LO_SEL_FACTOR  15
  72. #define XmCOLOR_LO_BS_FACTOR   60
  73. #define XmCOLOR_LO_TS_FACTOR   50
  74.  
  75.  
  76. /* For the default color calculation and caching */
  77.  
  78. #define XmLOOK_AT_SCREEN          (1<<0)
  79. #define XmLOOK_AT_CMAP            (1<<1)
  80. #define XmLOOK_AT_BACKGROUND      (1<<2)
  81. #define XmLOOK_AT_FOREGROUND      (1<<3)
  82. #define XmLOOK_AT_TOP_SHADOW      (1<<4)
  83. #define XmLOOK_AT_BOTTOM_SHADOW   (1<<5)
  84. #define XmLOOK_AT_SELECT          (1<<6)
  85.  
  86. #define XmBACKGROUND     ((unsigned char) (1<<0))
  87. #define XmFOREGROUND     ((unsigned char) (1<<1))
  88. #define XmTOP_SHADOW     ((unsigned char) (1<<2))
  89. #define XmBOTTOM_SHADOW  ((unsigned char) (1<<3))
  90. #define XmSELECT         ((unsigned char) (1<<4))
  91. #define XmHIGHLIGHT      ((unsigned char) (1<<5))
  92.  
  93. /*  Structure used to hold color schemes  */
  94. typedef struct _XmColorData
  95. {  Screen * screen;
  96.    Colormap color_map;
  97.    unsigned char allocated;
  98.    XColor background;
  99.    XColor foreground;
  100.    XColor top_shadow;
  101.    XColor bottom_shadow;
  102.    XColor select;
  103. } XmColorData;
  104.  
  105. #ifdef __cplusplus
  106. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  107. #endif
  108.  
  109.  
  110. #endif /* _ColorP_h */
  111. /* DON'T ADD STUFF AFTER THIS #endif */
  112.